﻿@inherits AutoCompleteModel<Entity.RelyingParty>
@inject IAdminStore<Entity.RelyingParty> _store

<AuthorizeView Policy="@SharedConstants.WRITERPOLICY">
    <Authorized>
        <div id="@Id" @key="@Entity" class="input-group input-group-sm mb-3" data-bs-toggle="dropdown">
            <input type="text" class="form-control new-claim" placeholder="@Localizer["relying party"]" value="@CurrentValue"
                    @oninput="OnInputChanged" @onfocus="Filter" />
        </div>
        <div class="dropdown-menu m-0">
            @if (_filteredParties != null)
            {
                foreach (var party in _filteredParties)
                {
                    <button class="dropdown-item m-0 p-0 pl-1 pr-1" type="button" @onclick="() => SetSelectedValue(party.Id)">
                        <small>@party.Id</small>
                    </button>
                }
            }
        </div>        
    </Authorized>
    <NotAuthorized>
        <span class="form-control-plaintext">@Entity.Id</span>
    </NotAuthorized>
</AuthorizeView>
